{% extends "layout.html" %}
{% block subtitle %}Topic{% endblock %}

{% from "snipple/macro.html" import navigation with context%}
{% block nav %}
{{ navigation('other') }}
{% endblock %}

{% block content %}
<div class="panel panel-default">
<div class="panel-heading">
  <a href="#" class="topic-avatar"><img src="{{ topic.avatar }}"></a>
  <div class="panel-title">
    <h3>{{ topic.title }}</h3>
  </div>
  <div>
    by <a href="#" class="topic-username">{{ topic.username }}</a> at
    {{ topic.post_time.strftime('%Y-%m-%d %H:%M:%S') }}
  </div>
</div>
<div class="panel-body">{{ topic.body_md | safe }}</div>
</div>

{% include "snipple/comment.html" %}
{% endblock %}

{% block sidebar %}
<div class="panel panel-default">
	<div class="panel-heading">Side Bar</div>
	<div class="panel-body">
    {% if current_user.is_authenticated() %}
    <a href="/user/{{current_user.username}}"><img src="{{ current_user.avatar(80) }}"></a>
	  <a class='btn btn-default' href='/post-topic'>Create New</a>
    {% endif %}
	</div>
</div>
{% endblock %}
